/*
 * @Description:
 * @Version: 1.0
 * @Autor: lzc
 * @Date: 2021-07-14 14:07:26
 * @LastEditors: lzc
 * @LastEditTime: 2021-07-20 10:25:09
 */
/*********************************************************************
*                     SEGGER Microcontroller GmbH                    *
*        Solutions for real time microcontroller applications        *
**********************************************************************
*                                                                    *
*        (c) 1996 - 2021  SEGGER Microcontroller GmbH                *
*                                                                    *
*        Internet: www.segger.com    Support:  support@segger.com    *
*                                                                    *
**********************************************************************
----------------------------------------------------------------------
File        : ID_SCREEN_01_Slots.c
Purpose     : AppWizard managed file, function content could be changed
---------------------------END-OF-HEADER------------------------------
*/

#include "Application.h"
#include "startup.h"
#include "GUI_Builder.h"
#include "../Generated/Resource.h"
#include "../Generated/ID_SCREEN_01.h"
extern WM_Status_t WM_Status;
/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       cbID_SCREEN_01
*/
void cbID_SCREEN_01(WM_MESSAGE *pMsg)
{
    // GUI_USE_PARA(pMsg);
    int     KeyValue;
    switch (pMsg -> MsgId)
    {
    case WM_INIT_DIALOG:
        initGraph(pMsg -> hWin, 100, 400);
        rt_kprintf("WM_InitDlog\r\n");
        break;
    case WM_PAINT:
        TEXT_SetText(WM_GetDialogItem(pMsg->hWin, ID_TEXT_Wave), "1550");
        break;
    case WM_KEY_USER_DEAL:
        KeyValue = GUI_GetKey();
        switch (KeyValue)
        {
        case GUI_KEY_LEFT:
            rt_kprintf("Left!!\r\n");
            break;
        case GUI_KEY_RIGHT:
            rt_kprintf("Right!!\r\n");
            break;
        case GUI_KEY_DOWN:
            rt_kprintf( " Confime ESC ,Free Space %d ,Used Space %d\r\n",
                        GUI_ALLOC_GetNumFreeBytes(), GUI_ALLOC_GetNumUsedBytes()); 
            WM_Status.Current_Screen = ID_SCREEN_00;
            APPW_SetVarData(ID_VAR_MAIN_SCREEN, 1);
            break;
        default:
            rt_kprintf("key is cilck");
            break;
        }
        GUI_ClearKeyBuffer(); 
        break;
    default:
        break;
    }
}
/*********************************************************************
*
*       ID_SCREEN_01__WM_NOTIFICATION_VALUE_CHANGED
*/
void ID_SCREEN_01__WM_NOTIFICATION_VALUE_CHANGED(APPW_ACTION_ITEM *pAction, WM_HWIN hScreen, WM_MESSAGE *pMsg, int *pResult)
{
    GUI_USE_PARA(pAction);
    GUI_USE_PARA(hScreen);
    GUI_USE_PARA(pMsg);
    GUI_USE_PARA(pResult);
}
/*************************** End of file ****************************/
